<!-- 商品搜索 -->
<div style="width: 100%;background-color: {$custom_template_v.control_data.goods_search.bg_color};padding: 10px 0;">
	<div class="editing">
		<div class="custom-search" style="background: {$custom_template_v.control_data.goods_search.input_bg_color};">
			<input type="text" class="custom-search-input" placeholder="{$custom_template_v.control_data.goods_search.placeholder}" style="background-color:{$custom_template_v.control_data.goods_search.input_bg_color};font-size:{$custom_template_v.control_data.goods_search.font_size}px;color:{$custom_template_v.control_data.goods_search.text_color};">
			<button type="button" class="custom-search-button">{:lang('search')}</button>
			<input type="hidden" value="{$shop_id}" id="hidden_shop_id"/>
		</div>
	</div>
</div>
<script>
	$(function(){
		$('.custom-search .custom-search-button').click(function(event) {
			var searchCont = $(this).prev('.custom-search-input').val();
			searchCont = searchCont.replace(/</g, "&lt;").replace(/>/g, "&gt;");
			if (searchCont != '') {
				if ($.cookie("searchRecordWap") != undefined) {
					var arr = eval($.cookie("searchRecordWap"));
				} else {
					var arr = new Array();
				}
				if (arr.length > 0) {
					if ($.inArray(searchCont, arr) < 0) {
						arr.push(searchCont);
					}
				} else {
					arr.push(searchCont);
				}
				$.cookie("searchRecordWap", JSON.stringify(arr));
				
				location.href = __URL(APPMAIN + '/goods/lists?keyword=' + searchCont);
			}
		});
	})
</script>